<?php
/**
 * Inquiry Types Maintenance Screen
 */

use Hive\Expense;
use Hive\Expense\Type;

$finder = new Type();
$result = $finder->find();
$grid = new Fox\Grid("gTypes");
$grid->fieldcat(array(array("keyid","typeid"),"label",array("expense_subtype","subtype"),"iedit","idele"));
$grid->fieldcat()->field("typeid")->noOutput();
$grid->fieldcat()->switchToObjectMode();
$grid->fieldcat()->setGenerators(array(
	'idele' => Fox\Generator::display('popForm', Fox\Generator::url(
		'expenses',
		'type',
		'delete',
		array(
			"id" => Fox\Generator::useAttribute('type')
		)
	)),
	'iedit' => Fox\Generator::display('popForm', Fox\Generator::url(
		'expenses',
		'type',
		'edit',
		array(
			"id" => Fox\Generator::useAttribute('type')
		)
	))
));
$grid->setDatas($result);
$grid->footer()->add(new Fox\Html\Button("add","Display('add','?mod=expenses&act=type&sac=edit');"));
echo "<h1>".Msg(Expense::MSGCL,6)."</h1>";
echo Xview::instance()->messages();
echo "<br>";
echo $grid->Display();